@extends('Admin.base')
@section('css')
    <link rel="stylesheet" href="/Admin/layuiadmin/css/extend/formSelects-v4.css" media="all">
    <style>
        .table td{
            width :400px;}
    </style>
@endsection
@section('content')

    <div class="layui-card">
        <div class="layui-card-body">
            <legend>订单详情</legend>
            <br>
            <table class="table" cellpadding="20px">
                <tr>
                    <td> 订单号：{{$order->online_order ?? ''}} </td>
                    <td>订单状态：{{array_key_exists($order->status, \App\Models\Order::STSTUS)? \App\Models\Order::STSTUS[$order->status] : ''}}     </td>
                    <td>用户昵称：{{$user->nickname ?? ''}}</td>
                </tr>
                <tr>
                    <td>下单时间：{{$order->created_at ?? ''}}</td>
                    <td>  付款方式：{{array_key_exists($order->pay_type, \App\Models\Order::PAY_TYPE)? App\Models\Order::PAY_TYPE[$order->pay_type] : ""}}</td>
                    <td> 用户姓名：{{$user->realname ?? ''}}</td>
                </tr>
                <tr>
                    <td> 付款时间：{{$order->pay_time ?? ''}}   </td>
                    <td> 售卖类型：{{\App\Models\Order::TYPE[$order->order_type]}}</td>
                    <td> 用户手机号码：{{$user->phone ?? ''}}</td>
                </tr>
                <tr>
                    <td>转为线上发货时间：{{$order->change_online_time ?? ''}}</td>
                    <td>  取货码：{{$order->pick_code ?? ''}}</td>
                    <td> 用户城市：{{$user->province ?? '', $user->city ?? ''}}</td>
                </tr>
                <tr>
                    <td>发货时间：{{$order->send_time ?? ''}}    </td>
                    <td>取货点位：{{$order->get_region ?? ''}}</td>
                    <td> 所属员工信息：
                    {{$order->userInfo ? ($order->userInfo->inviteUserInfo? $order->userInfo->inviteUserInfo->realname :''):""}}<br>
                    {{$order->userInfo ? ($order->userInfo->inviteUserInfo? $order->userInfo->inviteUserInfo->id :''):""}}<br>
                    {{$order->userInfo ? ($order->userInfo->inviteUserInfo?  $departmentList[$order->userInfo->inviteUserInfo->department]  : ''):""}}<br>
                    </td>
                </tr>
                <tr>
                    <td>  取货时间：{{$order->get_time ?? ''}}</td>
                    <td> 快递商：{{array_key_exists($order->express_name, \App\Models\Order::EXPRESS) ? \App\Models\Order::EXPRESS[$order->express_name] :""}}</td>
                    <td></td>
                </tr>
                <tr>
                    <td> 确认收货时间：{{$order->confirm_get_time ?? ''}}</td>
                    <td> 快递单号：{{$order->express_order ?? ''}}</td>
                    <td></td>
                </tr>
                <tr>
                    <td>申请售后时间：{{$order->after_sale_time ?? ''}}</td>
                    <td>发货操作人：{{isset($order->send_user) ? $adminer[$order->send_user] :""}}</td>
                    <td></td>
                </tr>
                <tr>
                    <td>用户申请售后备注：{{$order->after_sale_remark ?? ''}}</td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td>退款时间：{{$order->return_time ?? ''}}</td>
                    <td>退款金额:{{$order->return_money ?? ''}}</td>
{{--                    <td>退款申请人:{{$order->return_user}}</td>--}}
                    <td>退款申请人:{{$order->userInfo ? $order->userInfo->realname: ''}}</td>
                    <td>退款操作人:{{isset($order->return_creater) ? (array_key_exists($order->return_creater,$adminer) ? $adminer[$order->return_creater]:"") :""}}</td>
                </tr>
                <tr>
                    <td>收货人:{{$order->user_name ?? ''}}</td>
                    <td>收货人手机号码：{{$order->user_phone ?? ''}} </td>
                    <td>收货地址：{{$order->user_address ?? ''}}</td>
                    <td></td>
                </tr>
            </table>
            <table class="layui-table" id="LAY-table" lay-filter="LAY-table" widtr="700">
                <thead>
                    <th>商品标题</th>
                    <th>商品信息</th>
                    <th>单价</th>
                    <th>数量</th>
                    <th>折扣</th>
                    <th>折后单价</th>
                    <th>商品总价</th>
                </thead>
                <tbody>
                @foreach($goods as $v)
                    <tr>
                        <td><img src="{{$v->photo ?? ""}}" width="30px" height="30px">{{$v->goods_name ?? ""}}</td>
                        <td>规格:{{array_key_exists($v->norm_unit,$norm) ? $norm[$v->norm_unit] : ""}}<br>
                            编码:{{$v->sku ?? ""}}
                        </td>
                        <td>{{numberFormat($v->price,2)}}</td>
                        <td>{{$v->amount ?? ''}}</td>
                        <td>{{$v->is_sale==1 ? $v->sale ?? '' :1 }}</td>
                        <td>{{numberFormat($v->sale_price,2)}}</td>
                        <td>{{numberFormat($v->sale_price*$v->amount,2)}}</td>
                </tr>
                @endforeach
                </tbody>
            </table>
            <div align="right">
                商品小计：{{numberFormat($order->total_price,2)}}  <br>
                优惠券优惠：{{numberFormat($order->sale_ticket,2)}}  <br>
                满减优惠：{{numberFormat($order->full_less,2)}}  <br>
                八贝币抵扣：{{numberFormat($order->deduction_eight_consh,2)}} <br>
                运费：{{numberFormat($order->postage,2)}}  <br>
                实际支付：{{numberFormat($order->real_pay,2)}} <br>
            </div>
        </div>
    </div>
@endsection
@section('script')

@endsection